/**
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

/*
 * Base sheet for the whole app
 */

@import "constants";


.list-view, .tree-view, .table-view {
    -fx-selection-bar: @selection-focus-color;
    -fx-selection-bar-non-focused: @darker-accent-border;
}

.table-view {
    -fx-border-color: @darker-accent;
    -fx-padding: -1 0 0 0;

    .column-header {
        -fx-background-color: @darker-accent;
        -fx-border-color: @darker-accent-border;
        -fx-border-style: none solid solid solid;
        -fx-padding: -1 0 0 0;

        .label {
            -fx-font-weight: normal;
            -fx-border-color: @darker-accent;
            -fx-font-size: 9pt;
            -fx-min-height: 19pt;
            -fx-max-height: 19pt;
        }
    }

    .show-hide-columns-button {
        -fx-background-color: @darker-accent;
        -fx-border-color: @darker-accent-border;
        -fx-border-style: none solid solid solid;
        -fx-padding: -1 0 0 0;
    }
}

.text-area {
    -fx-background-insets: 0;
    -fx-background-color: transparent, white, transparent, white;
    -fx-background-radius: 0;

    -fx-box-border: none;
    -fx-focus-color: -fx-control-inner-background;
    -fx-faint-focus-color: -fx-control-inner-background;
    -fx-text-box-border: -fx-control-inner-background;
    -fx-border-width: -1;

    .content {
        -fx-background-color: transparent, white, transparent, white;
    }
}


.context-menu.no-scroll-arrows {

    .menu-item {
        // OK this is weird but it does solve a padding bug on the context menu.
        // Without it, items are offset to the bottom, and the last one is partially hidden
        -fx-border-style: solid;
        -fx-border-color: transparent;
    }

    .scroll-arrow {
        -fx-padding: 0;
    }

}

.split-pane {
    -fx-padding: 0;

    .split-pane-divider {
        -fx-padding: 0;
        -fx-border-color: transparent;
        -fx-background-color: @darker-accent;
    }
}


#nodeInfoPanel {
    .fix-width(300);
}

.titled-pane .title,
.info-title-bar {
    -fx-font-size: 9pt;
    -fx-pref-height: 24.0;
    -fx-border-radius: 0.0;
    -fx-background-radius: 0.0;
    -fx-background-color: @app-darker-slate-color;

    &.info-title-bar .label {
        -fx-padding: 0 0 0 6;
    }

}

#main-horizontal-split-pane > .split-pane-divider {
    -fx-background-color: @darker-accent-focus;
}

#main-toolbar,
.tool-bar.accent-header,
.split-pane.accent-header > .split-pane-divider {
    -fx-background-color: @app-darker-slate-color;
}


.tool-bar {
    .fix-height(30);
    -fx-border-color: transparent;
    -fx-border-width: .6;

    .button, .choice-box {
        -fx-background-color: @app-base-color;
        -fx-border-color: @darker-accent-border;
        -fx-border-radius: 3;
    }

    .button {
        -fx-padding: -3 5 -3 5;
    }
}

// This is used for buttons that have just an icon and no text
.button.icon-button {
    -fx-pref-width: 20;
    -fx-pref-height: 20;
}

/* This is the special button to reduce the lower split pane. */
.toggle-button.expand-toggle {
    -fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
    -fx-background-insets: 1 0 -1 0, 0;
    -fx-padding: 0.25em 0.3125em 0.25em 0.3125em; /* 3 3.75 3 3.75 */
    -fx-shape: "M 0 0 h 7 l -3.5 -4 z";

    .fix-height(5);
    .fix-width(10);

    &:selected {
        // This changes the shape to point upward
        -fx-shape: "M 0 0 h 7 l -3.5 4 z";
    }
}


.tab {
    -fx-background-insets: 0.0;
    -fx-background-radius: 0.0;
    -fx-padding: 0 30 0 30;
    -fx-border-color: transparent;
    -fx-background-color: transparent;

    &:selected {
        -fx-background-color: @darker-accent-focus;

        .focus-indicator {
            -fx-focus-color: transparent;
            -fx-border-color: transparent;
        }
    }

    &:focused, &:disabled {
        -fx-focus-color: transparent;
    }

    .tab-label {
        -fx-background-color: transparent;
        -fx-alignment: CENTER;
        -fx-padding: 0 10 0 10;
    }

}

.tab-pane {
    -fx-tab-min-height: 20px;
    -fx-tab-max-height: 20px;

    .tab-header-area {
        -fx-padding: 0;

        .tab-header-background {
            -fx-border-style: none none solid none;
            -fx-border-insets: 0 0 1pt 0;
            -fx-border-width: 0 0 1pt 0;
            -fx-border-color: transparent;
            -fx-background-color: @app-base-color;
        }

    }

    &:top .tab-header-area {
        -fx-background-insets: 0 0 1 0;
    }

    &:left .tab-header-area {
        -fx-background-insets: 0 1 0 0;
    }
}

// Useful link: http://www.guigarage.com/2015/11/styling-a-javafx-scrollbar/
.scroll-bar {

    -fx-padding: 0;

    * {
        -fx-background-color: white;
    }

    .thumb {
        -fx-background-color: derive(black, 90%);
        -fx-background-radius: 2em;
    }

    .increment-arrow, .decrement-arrow {
        -fx-shape: " ";
    }
}

// this is the corner when there is a horizontal and vertical scrollbar
.corner {
    -fx-background-color: white;
}
